package com.itdaan.portal.business.domain;
/**
 * @author www.itdaan.com
 */
public class SiteMapUrl {

	private String loc;//地址
	private String lastmod;//上次修改时间
	private String changefreq = "weekly";//修改频率
	private String priority = "1.0";//网页权重
	
	public String getLoc() {
		return loc;
	}
	public void setLoc(String loc) {
		this.loc = loc;
	}
	public String getChangefreq() {
		return changefreq;
	}
	public void setChangefreq(String changefreq) {
		this.changefreq = changefreq;
	}
	public String getPriority() {
		return priority;
	}
	public void setPriority(String priority) {
		this.priority = priority;
	}
	public String getLastmod() {
		return lastmod;
	}
	public void setLastmod(String lastmod) {
		this.lastmod = lastmod;
	}
	
	public String toXml(){
		StringBuffer sb = new StringBuffer();
		sb.append("<url>");
		sb.append("<loc>").append(this.getLoc()).append("</loc>");
		sb.append("<lastmod>").append(this.getLastmod()).append("</lastmod>");
		sb.append("<changefreq>").append(this.getChangefreq()).append("</changefreq>");
		sb.append("<priority>").append(this.getPriority()).append("</priority>");
		sb.append("</url>");
		return sb.toString();
	}
	
	public static void main(String[] args) {
		SiteMapUrl siteMapUrl = new SiteMapUrl();
		siteMapUrl.setLoc("http://www.itdaan.com/index.html");
		siteMapUrl.setLastmod("2015-06-09");
		System.out.println(siteMapUrl.toXml());
	}
}
